package co.com.ces4.client.baseView;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tree.TreeGrid;

/**
 *
 * @author win
 */
public class ViewBase extends VLayout {

    public VLayout systemMenu, logo;
    public HLayout HeaderPage, footerPage, SystemCoreContainer, formsContainer;

    public ViewBase() {
        setWidth(1024);
        setHeight(750);
        this.HeaderPage = new HLayout();
        this.footerPage = new HLayout();
        this.SystemCoreContainer = new HLayout();
        this.formsContainer = new HLayout();
        this.logo = new VLayout();
        this.systemMenu = new VLayout();

        this.HeaderPage.setWidth(1024);
        this.HeaderPage.setHeight(100);

        this.logo.setWidth(270);
        this.logo.setHeight(100);

        this.HeaderPage.addMember(logo);

        this.footerPage.setWidth(1024);
        this.footerPage.setHeight(50);

        this.SystemCoreContainer.setWidth(1024);
        this.SystemCoreContainer.setHeight(718);

        this.formsContainer.setWidth(784);
        this.formsContainer.setHeight(718);

        this.systemMenu.setWidth(240);
        this.systemMenu.setHeight(718);

        this.SystemCoreContainer.addMember(systemMenu);
        this.SystemCoreContainer.addMember(formsContainer);

        addMember(this.HeaderPage);
        addMember(this.SystemCoreContainer);
        addMember(this.footerPage);
    }

    public void addMenuItem(TreeGrid item) {
        this.systemMenu.addMember(item);
    }

    public void addLogoItem(Canvas item) {
        this.logo.addMember(item);
    }

    public void addFormsContainerItem(CreateBase item) {

        this.formsContainer.addMember(item);
    }

    public void addFooterItem(Canvas item) {
        this.footerPage.addMember(item);
    }

    public void setHeaderBackground(String background) {
        HeaderPage.setBackgroundImage(background);
    }

    public void setFooterBackground(String background) {
        footerPage.setBackgroundImage(background);
    }

    public void setMenuBackground(String background) {
        systemMenu.setBackgroundImage(background);
    }

    public void setFormContainerBackground(String background) {
        formsContainer.setBackgroundImage(background);
    }

    public void clearFormContainer() {
        this.formsContainer = new HLayout();
        this.formsContainer.setWidth(784);
        this.formsContainer.setHeight(568);
    }
}
